package com.demo.java.spring.ioc;

/**
 *   <bean id="factoryMethodBean" class="com.demo.java.spring.ioc.FactoryMathodTest"/>
 *   <!-- 通过 factory bean 的bean实例，调用 createChildren 方法创建实例对象 -->
 *   <bean name="children1" factory-bean="factoryMethodBean" factory-method="createChildren"/>
 *   <!-- 通过factory bean的静态方法创建实例对象 -->
 *   <bean name="children2" class="com.demo.java.spring.ioc.FactoryMathodTest" factory-method="staticCreateChildren"/>
 */
public class FactoryMathodTest {
    public Children createChildren() {
        System.out.println("invoke factory bean factory method create bean");
        return new Children();
    }
    public static Children staticCreateChildren() {
        System.out.println("invoke static create bean");
        return new Children();
    }
}
